package com.harisucici.websocketlib.utils;


import android.content.Context;

import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class WebExecutorService {
    private static ThreadPoolExecutor threadPoolExecutor;
    private Context context;

    public static synchronized ThreadPoolExecutor getInstance() {
        int nThreads = Constants.THREADS;
        if (threadPoolExecutor == null) {
            threadPoolExecutor = new ThreadPoolExecutor(nThreads, nThreads, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingDeque<>());
        }
        return threadPoolExecutor;
    }

}
